1. Field of the Invention
The present invention relates to an estimation of a high-speed motion in an encoder for the compression of a picture, and more particularly, to a high-speed motion estimation apparatus and method, which have a sharable multiple input/output bank memory structure.
2. Description of the Related Art
An encoder for the compression of a picture (hereinafter, referred to as “a picture encoder”) estimates motion by macroblock unit of a specific pixel size, and predicts a motion vector of a position where the value of a Sum of Absolute Differences (hereinafter, referred to as “SAD”) between macroblocks is the minimum. Herein, the macroblock includes a pixel having a specific position which is in a current picture (original picture) and a restored picture within a motion-estimation range (reference picture).
In a related art picture encoder, the pixel data of an original picture and a reference picture necessary for inter prediction increase relatively as the resolution of pictures increases. Consequently, the picture encoder stores the pixel data of a reference picture in an external frame memory having a large storage capacity, and reads and calculates the pixel data of the original picture and the pixel data of the reference picture, which are stored in the frame memory, with a motion estimation apparatus.
In the picture encoder, decimal-times motion estimation is performed after integer-times motion estimation by an integer-times motion estimation apparatus. Accordingly, after the integer-times motion estimation, the integer-times motion estimation apparatus again calculates the SAD of the original picture and the reference picture of an estimation range which is made by adding a periphery estimation range for pixel interpolation to a predicted periphery pixel range of an integer-times motion vector, and predicts a final decimal-times motion vector by use of the calculated SAD. The motion estimation prediction of the picture encoder will be described in detail with reference to FIG. 1 below.
The basic size of a macroblock necessary for general integer-times motion estimation uses 16×16 pixel data, and the range of one pixel uses 8 bits. The integer-times motion estimation apparatus calculates the SAD of a macroblock unit on the candidate pixel values of all estimation regions in the regions of the range of −16 to +15 in an X direction and the range of −16 to +15 in a Y direction, and predicts a motion vector by use of the calculated SAD. At this point, a clock cycle necessary for reading data from the frame memory, as illustrated in FIG. 1, requires a 64 clock cycle in reading the pixel data of a 16×8 bit (pixel)×16 (line) when one word is 64 bits on the original picture. Moreover, in the case of the reference picture of the estimation range, the clock cycle requires a 572 clock cycle in reading the pixel data of a 48×8 bit (pixel)×48 (line). The clock cycle is an ideal numerical value.
The integer-times motion estimation requires more clock cycles, because a delay time, occurring according to the storage position of pixel data, is additionally required when reading data from an actual frame memory (for example, a Synchronous Dynamic Random Access Memory (SDRAM) or a Double Data Rate (DDR) memory).
Upon calculation of the SAD, a 1024 clock cycle is required in an X and Y estimation range (32×32) because of the performance of calculations on the pixel values of all estimation regions.
The picture encoder must identically read the pixel data of an estimation region from the frame memory for decimal-times estimation. For this, the picture encoder uses a 6-tap filter. The 6-tap filter is for performing ¼ pixel interpolation in the periphery of an integer-times motion vector. Since the 6-tap filter requires additional periphery pixel data, it requires an estimation region pixel data of a 22×8 bit (pixel)×22 (line) from the frame memory for decimal-times motion estimation. In addition, a 121 clock cycle is required for reading the estimation-region pixel data. In the decimal-times estimation, the performance of the picture encoder may be deteriorated because the calculation time of the SAD and the input/output time of the frame memory are primarily focused upon the prediction of motion estimation.
In the picture encoder, a motion estimation apparatus requires more pixel data from the frame memory than other devices (for example, an intra prediction device or a distortion removing filter) of the picture encoder necessary for the entirety of the encoding.
The picture encoder performs encoding on a pipeline of a macroblock unit, and other devices of the picture encoder also require the pixel data of the frame memory at the same time state on the pipeline. Therefore, in the case of the picture encoder, due to the limited bandwidth of the memory, the input/output function of a stored memory may become bottlenecked. Consequently, a motion estimation apparatus may not be able to read the pixel data necessary for a calculation from the frame memory within a predetermined time upon estimation of motion.
Moreover, the picture encoder must perform a calculation in consideration of all the candidate pixel values of an estimation region when calculating the SAD for obtaining a motion vector. Accordingly, the picture encoder requires a large amount of calculations, and thus, since much processing time is taken per macroblock, delayed processing time deteriorates the overall performance of the picture encoder.